#include <iostream>
#include "factory_method.h"
using std::cout;
using std::endl;

void ProductA::Operation()
{
    cout << "I am ProductA" << endl;
}

void ProductB::Operation()
{
    cout << "I am ProductB" << endl;
}

void Creator::SomeOperation() const
{
    Product* product = this->FactoryMethod();
    // Now, use the product.
    product->Operation();
    delete product;
}

Product* ConcreteCreatorA::FactoryMethod() const
{
    return new ProductA();
}

Product* ConcreteCreatorB::FactoryMethod() const
{
    return new ProductB();
}